#ifndef __STRUCTDATA_HEAD__
#define __STRUCTDATA_HEAD__

#include "common.h"
#include <string>
#include <QObject>

class TabBase;

class GlobalOper{
  public:
    GlobalOper();
    virtual ~GlobalOper();
    void rosNodeConnect(bool conn);
    virtual void connected()=0;
    virtual void notConnected()=0;
};
class SData : public GlobalOper
{
  public:
    SData();
    virtual ~SData();
    virtual void connected();
    virtual void notConnected();
  
  private:
    TabSort tabSort_;
};

class TabRosConnData : public QObject,public SData
{
  Q_OBJECT
  public:
    TabRosConnData(TabBase* tab);
    TabRosConnData();
    ~TabRosConnData();
    
    void setRosMasterUrl(std::string url);
    std::string getRosMasterUrl();
    
    void setRosIP(std::string rosip);
    std::string getRosIP();
    
    void setRemem(bool isRemember);
    bool getRemem();
    
    void setAutoConn(bool autoconn);
    bool getAutoConn();
    
    void setUseLocalNode(bool isuse);
    bool getUseLocalNode();
    
  Q_SIGNALS:
    void rosConnectSignals(bool val);    
  private:
    std::string ros_master_url_;
    std::string ros_ip_;
    bool isRememberData_;
    bool isAutoConnNext_;
    bool isUseLocalNode_;
    
    TabBase* tab_;
  
    void initWork();
    virtual void connected();
    virtual void notConnected();
};


#endif
